package com.scoring.system.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.scoring.system.mapper.MoralAchievementMapper;
import com.scoring.system.pojo.MoralAchievement;
import com.scoring.system.service.MoralAchievementService;
@Service("moralAchievementService")
public class MoralAchievementServiceImpl implements MoralAchievementService {
	
	@Resource
	private MoralAchievementMapper maDao;

	@Override
	public int deleteById(int id) {
		return maDao.deleteByPrimaryKey(id);
	}

	@Override
	public int saveMoralAchievement(MoralAchievement record) {
		return maDao.insertSelective(record);
	}

	@Override
	public MoralAchievement getMoralAcievementById(int id) {
		return maDao.selectByPrimaryKey(id);
	}

	@Override
	public List<MoralAchievement> listMoralAchievementByClass(int classId) {
		return maDao.listMoralAchievementByClass(classId);
	}

	@Override
	public int updateMoralAchievement(MoralAchievement record) {
		return maDao.updateByPrimaryKeySelective(record);
	}

	@Override
	public MoralAchievement getMoralAcievementByStudent(int studentId) {
		return maDao.selectByStudent(studentId);
	}

}
